import Router from "koa-router";
import httpRequest from "@/utils/http";
import { Result } from "@/utils/result";

const topListRouter = new Router({ prefix: "/api/daily/toplist" });

topListRouter.get("/", async (ctx, next) => {
    const { id } = ctx.request.query;

    const res = await httpRequest.get({
        baseURL: `https://api.codelife.cc/api/top/list?lang=cn&id=${id}`
    });
    Result.ok(ctx, res.data);
});

export default topListRouter;
